package com.demo.modules.mq.rabbit.service.topic;

import com.demo.modules.mq.rabbit.RabbitAnnouncementMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;


/**
 * 消息消费者
 *
 * @author Rog
 */
@Component
@Slf4j
public class RabbitTopicMessageConsumerService {

    /**
     * topic交换机模式
     *
     * @param rabbitAnnouncementMessage
     */
    @RabbitListener(queues = "topic.queue07")
    public void topicQueueMq1(RabbitAnnouncementMessage rabbitAnnouncementMessage) {
        log.info("topicQueueMq1" + "接收到的消息为{}", rabbitAnnouncementMessage);
    }

    @RabbitListener(queues = "topic.queue08")
    public void topicQueueMq2(RabbitAnnouncementMessage rabbitAnnouncementMessage) {
        log.info("topicQueueMq2" + "接收到的消息为{}", rabbitAnnouncementMessage);
    }
}
